package cn.tedu.salary.service.impl;


import cn.tedu.salary.dao.mapper.SalaryMapper;
import cn.tedu.salary.pojo.dto.SalaryQuery;
import cn.tedu.salary.pojo.vo.SalaryVO;
import cn.tedu.salary.service.SalaryService;
import cn.tedu.salary.util.PageBen;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class SalaryServiceImpl implements SalaryService {

    @Autowired
    private SalaryMapper salaryMapper;


    @Override
    public PageBen<SalaryVO> queryPage(SalaryQuery salaryQuery) {
        Integer count = salaryMapper.queryCount(salaryQuery);
        if(count == 0){
            return new PageBen<>();
        }
        List<SalaryVO> list = salaryMapper.queryData(salaryQuery);
        return new PageBen<>(count,list);
    }
}
